<!--------------------------------------------------------------
>//	Company:	HTHK
>//	NAME:	    StaffReport.jsp
>//	TITLE:	    Monthly Staff Report by Project
>//	FUNCTION:	Report Monthly Staff by Project
>//	BY:	        Mike Cheng
>//	DATE:	    17/12/2003
>//	update_date:	14-01-2004
>//	update_by:	Poly Li
>// --------------------------------------------------------------
-->

<%@ include file="../tssheader.jsp" %>
<%@ page import="java.util.*" %>
<%@ page import="java.lang.*" %>
<%@ page import="tss.options.*" %>
<%@ page import="tss.jobreport.*" %>

<%
	//Modify by Poly Li//
	

	String projectName = (String)session.getAttribute("project_name");
	String staffName = (String)session.getAttribute("staff_name");
	
	String yearFrom = (String)session.getAttribute("year_from");
	String monthFrom = (String)session.getAttribute("month_from");
	String yearTo = (String)session.getAttribute("year_to");
	String monthTo = (String)session.getAttribute("month_to");
	String dayFrom = (String)session.getAttribute("day_from");
	String dayto = (String)session.getAttribute("day_to");

	Vector staffReportResult = (Vector)request.getAttribute("staffReportResult");
	Vector report_date = (Vector)request.getAttribute("reportDate");
	ChangeNum num = new ChangeNum();

%>

<body >
<h2>Monthly Staff Report by Project</h2>
<table>
<%	if(staffName != null && staffName.length() != 0){	%>
<tr>
	<td>Staff No:</td>
	<td><%= staffName %></td>
</tr>
<%	}if(projectName != null && projectName.length() != 0){	%>
<tr>
	<td>Project Name:</td>
	<td><%= projectName %></td>
</tr>
<%	}	%>

</table>

<br>

<%
	int dateIndex = 0;
	for(int i = 0;i<staffReportResult.size();i++)
	{
		ReportContainer ReportContainerList = (ReportContainer)staffReportResult.get(i);
		Vector reportResult = (Vector)ReportContainerList.getProjects();
		if(reportResult.size() == 0)
			continue;

		String reportDate[] = new String[1];
		reportDate = (String[])report_date.get(dateIndex);
		dateIndex++;
%>
<table>
<tr>
	<td>Date From: </td>
        <td><%= reportDate[0]+"/"+ reportDate[1]%></td>
</tr>
<tr>
	<td>Date To: </tdd>
        <td><%= reportDate[0]+"/"+ reportDate[2] %></td>
</tr>
</table>


<table border=1>
<tr>
  <td><b>Staff No</b></td>
  <td><b>Staff Name</b></td>
  <td><b>Project Name</b></td>
  <td><b>Hours</b></td>
</tr>

<%
		for(int n=0;n<reportResult.size();n++)
		{
			String staffProject[] = new String[4];
			staffProject = (String[])reportResult.get(n);
%>
<tr>
    <td><%= staffProject[0] %></td>
    <td><%= staffProject[1] %></td>
    <td><%= staffProject[2] %></td>
    <td align=right><%= num.getFixNum(staffProject[3],2) %></td>
</tr>
<tr>
</tr>
<%		}	%>
</table><br>
<%	}	%>


<br>
<hr>
<p>
<INPUT type=button value=Back onclick="location.href='<%=contextPath%>/tss/staffreport/StaffExport.jsp'">
</p>
</body>
<%@ include file="../tssfooter.jsp" %>
</body>
</html>
